package com.ipoint.intr.smartCatalog.model.element;

import java.util.List;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.OneToMany;

import org.hibernate.validator.NotNull;
import org.jboss.seam.annotations.Name;

import com.ipoint.intr.smartCatalog.model.BaseObject;

@Entity
@Name("element")
public class Element extends BaseObject {
	@NotNull
	private String uid;

	@OneToMany(mappedBy = "element", fetch = FetchType.EAGER)
	private List<Value> values;

	public List<Value> getValues() {
		return values;
	}

	public void setValues(List<Value> values) {
		this.values = values;
	}

	public String getUid() {
		return uid;
	}

	public void setUid(String uid) {
		this.uid = uid;
	}

	@Override
	protected void toStringValues(StringBuffer result) {
		super.toStringValues(result);
		result.append(",").append("uid-").append(this.getUid());
	}

}
